home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Tele / A / AnalyzeCL Utils.cpt / CLAnalysis Stacks.sit / BBS Stats / background_6089.txt < prev    next >
Encoding:
Text File  |  1989-05-23  |  13.3 KB  |  615 lines

  1. -- background: 6089 from stack: in
  2. -- bmap block id: 6712
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: Graph
  6. ----- HyperTalk script -----
  7. on openCard
  8.   push recent card
  9.   pass openCard
  10. end opencard
  11.  
  12. on closeCard
  13.   repeat with i=1 to the number of bkgnd buttons
  14.     set hilite of bkgnd button i to false
  15.   end repeat
  16.   pass closeCard
  17. end closecard
  18.  
  19. on clearScreen
  20.   choose select tool
  21.   doMenu select all
  22.   doMenu clear picture
  23.   repeat with i=1 to the number of bkgnd buttons
  24.     set hilite of bkgnd button i to false
  25.   end repeat
  26. end clearScreen
  27.  
  28. function frheight
  29. return 260
  30. end frameheight
  31.  
  32. function framewidth
  33. return 310
  34. end framewidth
  35.  
  36. function framebottom
  37. return 280
  38. end framebottom
  39.  
  40. function frameleft
  41. return 105
  42. end frameleft
  43.  
  44. function maxline what
  45. put 0 into result
  46. repeat with i = 1 to the number of lines in what
  47.   put max(line i of what,result) into result
  48. end repeat
  49. return result
  50. end maxLine
  51.  
  52. on drawframe  drawX
  53.   global y2ofs
  54.   reset paint
  55.   choose text tool
  56.   set the textFont to Geneva
  57.   set textSize to 9
  58.   set textAlign to Center
  59.   put the number of lines in field "X" into datacount
  60.   put frameleft() into horiz
  61.   put round(framewidth()/(dataCount-1)) into XStep
  62.   choose line tool
  63.   drag from frameleft(),framebottom()-frheight() to frameleft(),framebottom()
  64.   repeat with i = 1 to dataCount
  65.     get line i of field "X"
  66.     if drawX and ((Xstep > 12) or ( i mod 2 = 1)) then
  67.       choose text tool
  68.       click at horiz,framebottom()+30
  69.       type it
  70.       doMenu Select
  71.       doMenu rotate right
  72.       choose line tool
  73.       drag from horiz,framebottom()+3 to horiz,framebottom()
  74.     end if
  75.     add XStep to horiz
  76.   end repeat
  77.   choose line tool
  78.   subtract XStep from horiz
  79.   put horiz into y2ofs
  80.   drag from frameleft(),framebottom() to horiz,framebottom()
  81.   drag from horiz,framebottom()-frheight() to horiz,framebottom()
  82.   reset paint
  83.   choose browse tool
  84. end drawframe
  85.  
  86. on drawY  fld, algn, xpos
  87.   reset paint
  88.   choose text tool
  89.   set the textFont to Geneva
  90.   set textSize to 9
  91.   set textHeight to 9
  92.   set textAlign to algn
  93.   put maxLine (field fld) into maxY
  94.   if maxY < 18 then put maxY into incr else put 18 into incr
  95.   put the number of lines in field fld into datacount
  96.   put round(frheight()/incr) into Y1Step
  97.   put framebottom() into vert
  98.   repeat with i = 0 to incr
  99.     choose text tool
  100.     put round(maxY/incr*i) into ndx
  101.     put round(frheight()* ndx / maxY) into height1
  102.     -- put round((frheight()/incr*i ) into height1
  103.     -- click at xpos,vert
  104.     click at xpos,framebottom()-height1
  105.     if algn = "left" then type "_"
  106.     type round(maxY/incr*i)
  107.     if algn = "right" then type "_"
  108.     subtract Y1Step  from vert
  109.   end repeat
  110.   choose browse tool
  111. end drawY
  112.  
  113. on getData src,bkg,dst
  114.   put "" into field dst
  115.   if (the number of cards in background bkg) < 3 then
  116.     answer "No data! Use Load Data first." with "OK"
  117.     put "0" & return & "1" into field dst
  118.   else
  119.     repeat with i = 2 to the number of cards in background bkg
  120.       set the cursor to busy
  121.       put (field src of card i of background bkg) & return after field dst
  122.     end repeat
  123.   end if
  124. end getData
  125.  
  126. on drawgraph  fld,pat,sclfld
  127.   reset paint
  128.   choose line tool
  129.   set lineSize to 2
  130.   set pattern to pat
  131.   put maxLine (field sclfld) into maxY
  132.   put the number of lines in field fld into datacount
  133.   put round(framewidth()/dataCount) into Y1Step
  134.   put frameleft() into horiz
  135.   put round(framewidth()/(dataCount-1)) into XStep
  136.   get line 1 of field fld
  137.   if it is not empty then
  138.     put round(frheight() * it / maxY) into height1
  139.     repeat with i = 2 to dataCount
  140.       get line i of field fld
  141.       if it is not empty then
  142.         put round(frheight() * it / maxY) into height
  143.         drag from horiz,framebottom()-height1 to horiz+XStep,framebottom()-height with OptionKey
  144.         put height into height1
  145.       end if
  146.       add XStep to horiz
  147.     end repeat
  148.   end if
  149.   reset paint
  150.   choose browse tool
  151. end drawgraph
  152.  
  153. function nxtpat
  154. global lstpat
  155. if lstpat = 12
  156. then
  157. return 22
  158. else
  159.   if lstpat = 22 then
  160.     return 20
  161.   else
  162.     if lstpat = 20 then
  163.       return 13
  164.     else
  165.       if lstpat = 13 then
  166.         return 3
  167.       else
  168.         return 30
  169.       end if
  170.     end if
  171.   end if
  172. end if
  173. end nxtpat
  174.  
  175. on doLegend  pat
  176.   reset paint
  177.   if pat = 12 then  put 27 into yofs
  178.   if pat = 22 then  put 49 into yofs
  179.   if pat = 20 then  put 71 into yofs
  180.   if pat = 13 then  put 93 into yofs
  181.   if pat =  3 then  put 115 into yofs
  182.   if pat = 30 then  put 137 into yofs
  183.   choose text tool
  184.   set textAlign to center
  185.   set textSize to 12
  186.   set textFont to Chicago
  187.   click at 35,yofs
  188.   type the short name of the target
  189.   choose line tool
  190.   set lineSize to 2
  191.   set pattern to pat
  192.   drag from 15,yofs+5 to 55,yofs+5 with optionKey
  193.   choose browse tool
  194. end doLegend
  195.  
  196. on graphY1  fld
  197.   global lstpat, newdata
  198.   put 12 into lstpat
  199.   if newdata then
  200.     getdata "X_fld",the short name of this card,"X"
  201.     clearscreen
  202.     drawframe true
  203.     put "false" into newdata
  204.   else
  205.     send mouseUp to bkgnd button "Clear"
  206.   end if
  207.   getdata  fld,the short name of this card,"Y1"
  208.   drawY "Y1",right,frameleft()-1
  209.   drawgraph "Y1",12,"Y1"
  210.   set hilite of the target to true
  211.   doLegend lstpat
  212. end graphY1
  213.  
  214. on graphY2  fld
  215.   global lstpat, y2ofs
  216.   put the optionkey is down into opt
  217.   if y2ofs = 0 then put frameleft()+FrameWidth()+5 into y2ofs
  218.   put nxtpat() into lstpat
  219.   if opt then
  220.     getdata  fld,the short name of this card,"Y2"
  221.     drawY "Y2",left,y2ofs+2
  222.     drawgraph "Y2",lstpat,"Y2"
  223.   else
  224.     getdata  fld,the short name of this card,"Y2"
  225.     if (lstpat = 12) OR (lstpat = 22) then
  226.       drawY "Y1",left,y2ofs+2
  227.     end if
  228.     drawgraph "Y2",lstpat,"Y1"
  229.   end if
  230.   set hilite of the target to true
  231.   doLegend lstpat
  232. end graphY2
  233.  
  234.  
  235.  
  236. -- part 2 (button)
  237. -- low flags: 00
  238. -- high flags: 8003
  239. -- rect: left=6 top=150 right=169 bottom=69
  240. -- title width / last selected line: 0
  241. -- icon id / first selected line: 0 / 0
  242. -- text alignment: 1
  243. -- font id: 0
  244. -- text size: 12
  245. -- style flags: 0
  246. -- line height: 16
  247. -- part name: Logins
  248. ----- HyperTalk script -----
  249. on mouseUp
  250.   graphY1(the short name of the target)
  251. end mouseUp
  252.  
  253.  
  254.  
  255. -- part 4 (button)
  256. -- low flags: 00
  257. -- high flags: 8003
  258. -- rect: left=6 top=172 right=191 bottom=69
  259. -- title width / last selected line: 0
  260. -- icon id / first selected line: 0 / 0
  261. -- text alignment: 1
  262. -- font id: 0
  263. -- text size: 12
  264. -- style flags: 0
  265. -- line height: 16
  266. -- part name: Usage
  267. ----- HyperTalk script -----
  268. on mouseUp
  269.   graphY1(the short name of the target)
  270. end mouseUp
  271.  
  272.  
  273.  
  274. -- part 5 (button)
  275. -- low flags: 00
  276. -- high flags: 8003
  277. -- rect: left=6 top=194 right=213 bottom=69
  278. -- title width / last selected line: 0
  279. -- icon id / first selected line: 0 / 0
  280. -- text alignment: 1
  281. -- font id: 0
  282. -- text size: 12
  283. -- style flags: 0
  284. -- line height: 16
  285. -- part name: Pub
  286. ----- HyperTalk script -----
  287. on mouseUp
  288.   graphY1(the short name of the target)
  289. end mouseUp
  290.  
  291.  
  292.  
  293. -- part 6 (button)
  294. -- low flags: 00
  295. -- high flags: 8003
  296. -- rect: left=6 top=238 right=257 bottom=69
  297. -- title width / last selected line: 0
  298. -- icon id / first selected line: 0 / 0
  299. -- text alignment: 1
  300. -- font id: 0
  301. -- text size: 12
  302. -- style flags: 0
  303. -- line height: 16
  304. -- part name: DL
  305. ----- HyperTalk script -----
  306. on mouseUp
  307.   graphY1(the short name of the target)
  308. end mouseUp
  309.  
  310.  
  311.  
  312. -- part 7 (button)
  313. -- low flags: 00
  314. -- high flags: 8003
  315. -- rect: left=6 top=216 right=235 bottom=69
  316. -- title width / last selected line: 0
  317. -- icon id / first selected line: 0 / 0
  318. -- text alignment: 1
  319. -- font id: 0
  320. -- text size: 12
  321. -- style flags: 0
  322. -- line height: 16
  323. -- part name: Pri
  324. ----- HyperTalk script -----
  325. on mouseUp
  326.   graphY1(the short name of the target)
  327. end mouseUp
  328.  
  329.  
  330.  
  331. -- part 8 (button)
  332. -- low flags: 00
  333. -- high flags: 8003
  334. -- rect: left=6 top=260 right=279 bottom=69
  335. -- title width / last selected line: 0
  336. -- icon id / first selected line: 0 / 0
  337. -- text alignment: 1
  338. -- font id: 0
  339. -- text size: 12
  340. -- style flags: 0
  341. -- line height: 16
  342. -- part name: UL
  343. ----- HyperTalk script -----
  344. on mouseUp
  345.   graphY1(the short name of the target)
  346. end mouseUp
  347.  
  348.  
  349.  
  350. -- part 9 (button)
  351. -- low flags: 00
  352. -- high flags: 8003
  353. -- rect: left=445 top=150 right=169 bottom=508
  354. -- title width / last selected line: 0
  355. -- icon id / first selected line: 0 / 0
  356. -- text alignment: 1
  357. -- font id: 0
  358. -- text size: 12
  359. -- style flags: 0
  360. -- line height: 16
  361. -- part name: Logins
  362. ----- HyperTalk script -----
  363. on mouseUp
  364.   graphY2(the short name of the target)
  365. end mouseUp
  366.  
  367.  
  368.  
  369. -- part 10 (button)
  370. -- low flags: 00
  371. -- high flags: 8003
  372. -- rect: left=445 top=172 right=191 bottom=508
  373. -- title width / last selected line: 0
  374. -- icon id / first selected line: 0 / 0
  375. -- text alignment: 1
  376. -- font id: 0
  377. -- text size: 12
  378. -- style flags: 0
  379. -- line height: 16
  380. -- part name: Usage
  381. ----- HyperTalk script -----
  382. on mouseUp
  383.   graphY2(the short name of the target)
  384. end mouseUp
  385.  
  386.  
  387.  
  388. -- part 11 (button)
  389. -- low flags: 00
  390. -- high flags: 8003
  391. -- rect: left=445 top=194 right=213 bottom=508
  392. -- title width / last selected line: 0
  393. -- icon id / first selected line: 0 / 0
  394. -- text alignment: 1
  395. -- font id: 0
  396. -- text size: 12
  397. -- style flags: 0
  398. -- line height: 16
  399. -- part name: Pub
  400. ----- HyperTalk script -----
  401. on mouseUp
  402.   graphY2(the short name of the target)
  403. end mouseUp
  404.  
  405.  
  406.  
  407. -- part 12 (button)
  408. -- low flags: 00
  409. -- high flags: 8003
  410. -- rect: left=445 top=216 right=235 bottom=508
  411. -- title width / last selected line: 0
  412. -- icon id / first selected line: 0 / 0
  413. -- text alignment: 1
  414. -- font id: 0
  415. -- text size: 12
  416. -- style flags: 0
  417. -- line height: 16
  418. -- part name: Pri
  419. ----- HyperTalk script -----
  420. on mouseUp
  421.   graphY2(the short name of the target)
  422. end mouseUp
  423.  
  424.  
  425.  
  426. -- part 13 (button)
  427. -- low flags: 00
  428. -- high flags: 8003
  429. -- rect: left=445 top=238 right=257 bottom=508
  430. -- title width / last selected line: 0
  431. -- icon id / first selected line: 0 / 0
  432. -- text alignment: 1
  433. -- font id: 0
  434. -- text size: 12
  435. -- style flags: 0
  436. -- line height: 16
  437. -- part name: DL
  438. ----- HyperTalk script -----
  439. on mouseUp
  440.   graphY2(the short name of the target)
  441. end mouseUp
  442.  
  443.  
  444.  
  445. -- part 14 (button)
  446. -- low flags: 00
  447. -- high flags: 8003
  448. -- rect: left=445 top=260 right=279 bottom=508
  449. -- title width / last selected line: 0
  450. -- icon id / first selected line: 0 / 0
  451. -- text alignment: 1
  452. -- font id: 0
  453. -- text size: 12
  454. -- style flags: 0
  455. -- line height: 16
  456. -- part name: UL
  457. ----- HyperTalk script -----
  458. on mouseUp
  459.   graphY2(the short name of the target)
  460. end mouseUp
  461.  
  462.  
  463.  
  464. -- part 15 (button)
  465. -- low flags: 00
  466. -- high flags: 0000
  467. -- rect: left=0 top=324 right=342 bottom=19
  468. -- title width / last selected line: 0
  469. -- icon id / first selected line: 1015 / 1015
  470. -- text alignment: 1
  471. -- font id: 0
  472. -- text size: 12
  473. -- style flags: 0
  474. -- line height: 16
  475. -- part name: 
  476. ----- HyperTalk script -----
  477. on mouseUp
  478.   global y2ofs
  479.   if the optionkey is not down then
  480.     repeat with i = 1 to 3
  481.       set visible of field i to not visible of field i
  482.     end repeat
  483.   else
  484.     drawY "Y1",right,frameleft()-1
  485.     drawY "Y2",left,y2ofs+2
  486.     drawgraph "Y1",12,"Y1"
  487.     drawgraph "Y2",22,"Y2"
  488.   end if
  489. end mouseUp
  490.  
  491.  
  492.  
  493. -- part 16 (button)
  494. -- low flags: 00
  495. -- high flags: 8003
  496. -- rect: left=459 top=7 right=32 bottom=497
  497. -- title width / last selected line: 0
  498. -- icon id / first selected line: 0 / 0
  499. -- text alignment: 1
  500. -- font id: 0
  501. -- text size: 12
  502. -- style flags: 0
  503. -- line height: 16
  504. -- part name: Clear
  505. ----- HyperTalk script -----
  506. on mouseUp
  507.   global y2ofs
  508.   put the optionkey is down into opt
  509.   if opt then
  510.     clearscreen
  511.   else
  512.     choose select tool
  513.     -- drag from frameleft()+1,framebottom()-1 -- to y2ofs-1,0
  514.     -- doMenu Clear Picture
  515.     -- drag from frameleft()-1,framebottom() -- to frameleft()-38,0
  516.     -- doMenu Clear Picture
  517.     -- drag from y2ofs+1,framebottom() -- to y2ofs+38,0
  518.     -- doMenu Clear Picture
  519.     -- drag from 0,0 to 75,150
  520.     drag from 1,framebottom()-1 to 512,0
  521.     doMenu Clear Picture
  522.   end if
  523.   drawframe opt
  524.   choose browse tool
  525.   repeat with i = 1 to the number of bkgnd buttons
  526.     set hilite of bkgnd button i to false
  527.   end repeat
  528. end mouseUp
  529.  
  530.  
  531.  
  532. -- part 25 (button)
  533. -- low flags: 00
  534. -- high flags: 8003
  535. -- rect: left=459 top=80 right=105 bottom=497
  536. -- title width / last selected line: 0
  537. -- icon id / first selected line: 0 / 0
  538. -- text alignment: 1
  539. -- font id: 0
  540. -- text size: 12
  541. -- style flags: 0
  542. -- line height: 16
  543. -- part name: Copy
  544. ----- HyperTalk script -----
  545. on mouseUp
  546.   choose select tool
  547.   doMenu select all
  548.   doMenu copy picture
  549.   choose browse tool
  550. end mouseUp
  551.  
  552.  
  553.  
  554. -- part 24 (button)
  555. -- low flags: 00
  556. -- high flags: 0000
  557. -- rect: left=463 top=40 right=70 bottom=497
  558. -- title width / last selected line: 0
  559. -- icon id / first selected line: 25002 / 25002
  560. -- text alignment: 1
  561. -- font id: 0
  562. -- text size: 12
  563. -- style flags: 0
  564. -- line height: 16
  565. -- part name: Help
  566. ----- HyperTalk script -----
  567. on mouseUp
  568.   push card
  569.   go to first card of this background
  570.   show card field "help"
  571. end mouseUp
  572.  
  573.  
  574.  
  575. -- part 17 (field)
  576. -- low flags: 80
  577. -- high flags: 4007
  578. -- rect: left=6 top=8 right=147 bottom=67
  579. -- title width / last selected line: 0
  580. -- icon id / first selected line: 0 / 0
  581. -- text alignment: 1
  582. -- font id: 3
  583. -- text size: 9
  584. -- style flags: 0
  585. -- line height: 12
  586. -- part name: Y1
  587.  
  588.  
  589. -- part 18 (field)
  590. -- low flags: 80
  591. -- high flags: 4007
  592. -- rect: left=446 top=8 right=147 bottom=507
  593. -- title width / last selected line: 0
  594. -- icon id / first selected line: 0 / 0
  595. -- text alignment: 1
  596. -- font id: 3
  597. -- text size: 9
  598. -- style flags: 0
  599. -- line height: 12
  600. -- part name: Y2
  601.  
  602.  
  603. -- part 19 (field)
  604. -- low flags: 80
  605. -- high flags: 4007
  606. -- rect: left=18 top=283 right=342 bottom=89
  607. -- title width / last selected line: 0
  608. -- icon id / first selected line: 0 / 0
  609. -- text alignment: 65535
  610. -- font id: 3
  611. -- text size: 9
  612. -- style flags: 0
  613. -- line height: 12
  614. -- part name: X
  615.